<template>
    <label>{{ label }}</label>
    <input type="text" placeholder="{{ placeholder }}" @change="onInputChanged" v-model="text"/>
</template>

<style>
</style>

<script>
export default{
  data: function () {
    return {
      label: '标题',
      placeholder: '请输入标题',
      inputChangedListener: null,
      text: ''
    }
  },
  methods: function () {
    return {
      onInputChanged: function (event) {
        console.log('this.text ' + this.text)
        if (this.inputChangedListener) {
          this.inputChangedListener.apply(this, [event, this.text])
        }
      }
    }
  }
}
</script>
